/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.hdm.gruppenkalender.team04.test;

/**
 *
 * @author Mark
 */
import java.awt.BorderLayout;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerDateModel;
import javax.swing.SpinnerModel;

public class SpinnerDemo extends JSpinner {

    public static void main(String[] args) {

        JFrame frame = new JFrame("JSpinner Sample");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        /*
        SpinnerDateModel model = new SpinnerDateModel();
        JSpinner spinner = new JSpinner(model);
        Date value = model.getDate();
        spinner.setValue(value);

        JFormattedTextField tf = JSpinner.DefaultEditor.;
        DefaultFormatterFactory factory =
        (DefaultFormatterFactory) tf.getFormatterFactory();
        DateFormatter formatter = (DateFormatter) factory.getDefaultFormatter();
         */
        SpinnerModel model = new SpinnerDateModel();
        JSpinner spinner = new JSpinner(model);
        JComponent editor = new JSpinner.DateEditor(spinner, "dd.MM.yyyy");
        spinner.setEditor(editor);

        JPanel panel1 = new JPanel(new BorderLayout());
        panel1.add(spinner, BorderLayout.CENTER);
        frame.add(panel1, BorderLayout.SOUTH);
        frame.setSize(200, 90);
        frame.setVisible(true);


    }
}
